package com.example.demo.controller;

import com.example.demo.entity.Source;
import com.example.demo.mapper.GaugeMapper;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/getGauge")
@CrossOrigin
public class GaugeController {

    @Resource
    GaugeMapper gaugeMapper;

    @GetMapping("/getSumStudent")
    public List<Source> getSumStudent() {
        List<Source> sourceList = gaugeMapper.getSumStudent();
        return sourceList;
    }

    @GetMapping("/getSumClass")
    public List<Source> getSumClass() {
        List<Source> sourceList = gaugeMapper.getSumClass();
        return sourceList;
    }
}
